<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <title>无标题文档</title>
    <link href="/static/css/default.css" rel="stylesheet" type="text/css">
    <link href="/static/css/style/green.css" rel="stylesheet" type="text/css" id='link'>
    <link rel="stylesheet" href="/static/kindeditor/themes/default/default.css" />
    <script charset="utf-8" src="/static/kindeditor/kindeditor-min.js"></script>
    <script charset="utf-8" src="/static/kindeditor/lang/zh-CN.js"></script>
    <link rel="stylesheet" href="/static/FileUpload/css/jquery.fileupload.css" />
</head>

<body style="overflow:hidden; padding:10px;">
    <form>
        <table class="formtable" style="width:580px;">

            <tbody>



              
                <tr>
                    <td class="tlabel">所属机构</td>
                    <td>
                        <select type="text" id="mid" class="select" required="required">
                            <option v-for="item in list" :value='item.id'>
                                {{item.name}}
                            </option>

                        </select>
                    </td>
                </tr>
                

            </tbody>

        </table>

        <div class="formbtn">
            <input type="button" value="保存" class="btnsave">
            <input type="button" value="取消" class="btncancel">
        </div>
        <input type="hidden" id="videoid" value="{$id}" />
        <input type="hidden" id="dailiid" value="{$dailiid}" />
    </form>


</body>
<script type="text/javascript" src="/static/js/jquery.js"></script>
<script type="text/javascript" src="/static/js/common.js"></script>
<script type="text/javascript" src="/static/js/vue2.js"></script>
<script src="/static/js/layer/layer.js"></script>
<script src="/static/My97DatePicker/WdatePicker.js"></script>
<script src="/static/FileUpload/js/vendor/jquery.ui.widget.js"></script>
<script src="/static/FileUpload/js/jquery.iframe-transport.js"></script>
<script src="/static/FileUpload/js/jquery.fileupload.js"></script>
<script>

    var vue = new Vue({
        el: '#mid',
        data: {
            list: [],
        },
        methods: {

            getdata: function () {
                var _self = this;//保存this的指向
                var dailiid =$("#dailiid").val();
                $.post('/super/mechanism/GetMechanismb_daili', {id:dailiid}, function (data) {
                    console.log(data);
                    _self.list = data;
                });
            }

        },
        created: function () {  //初始化事件里边去调用查询方法
            this.getdata();
        }
    });



    $(".btnsave").click(function () {

        var videoid = $("#videoid").val();
        var mid =$("#mid").val();

    
        $.post("/super/mechanism/fenpei", {
            "videoid": videoid, "mid": mid
        }, function (data) {
            if (data.status == 200) {
                var index = parent.layer.getFrameIndex(window.name);
                window.parent.iframe.contentWindow.location.reload(true);
                console.log(window.parent.iframe);
                parent.layer.close(index);
            } else {
                layer.msg(data.msg);
            }
        });
    });
    $(".btncancel").click(function () {
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    });



</script>

</html>